<div class="bg-light lter b-b wrapper-md">
    <h1 class="m-n font-thin h3">{{status.title}}</h1>
</div>
<div class="bg-light lter b-b wrapper-md">
    <table class="table table-striped">
        <tr>
            <td class="" style="width:15%">
                <input type="text" class="col-sm-2 form-control" placeholder="isbn" ng-model="query.isbn">
            </td>
            <td style="width:5%">
                <div class="input-group text-center">
                    <button type="button" class="btn m-b-xs btn-info btn-rounded" ng-click="search(query)">
                        查询并添加
                    </button>
                </div>
            </td>
        </tr>
    </table>
</div>
<div class="wrapper-md" ng-show="book">
    <form class="panel panel-default" name="form" novalidate>
        <div class="panel-heading font-bold">
            书籍信息
        </div>
        <div class="panel-body">
            <div class="form-horizontal" method="post" name="form">
                <div class="form-group">
                    <label class="col-sm-2 control-label">书籍名称</label>
                    <div class="col-sm-10">
                        <input class="form-control" ng-model="book.title" required>
                    </div>
                </div>
                <div class="line line-dashed b-b line-lg pull-in"></div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">isbn10</label>
                    <div class="col-sm-10">
                        <input class="form-control" ng-model="book.isbn10">
                    </div>
                </div>
                <div class="line line-dashed b-b line-lg pull-in"></div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">isbn13</label>
                    <div class="col-sm-10">
                        <input class="form-control" ng-model="book.isbn13">
                    </div>
                </div>
                <div class="line line-dashed b-b line-lg pull-in"></div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">出版社</label>
                    <div class="col-sm-10">
                        <input class="form-control" ng-model="book.publisher">
                    </div>
                </div>
                <div class="line line-dashed b-b line-lg pull-in"></div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">出版时间</label>
                    <div class="col-sm-10">
                        <div class="input-group">
                            <date-picker format="yyyy-MM-dd" ng-model="book.pubdate" place-holder="出版时间"></date-picker>
                        </div>
                    </div>
                </div>
                <div class="line line-dashed b-b line-lg pull-in"></div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">价格</label>
                    <div class="col-sm-10">
                        <input class="form-control" ng-model="book.price">
                    </div>
                </div>
                <div class="line line-dashed b-b line-lg pull-in"></div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">页数</label>
                    <div class="col-sm-10">
                        <input class="form-control" ng-model="book.pages">
                    </div>
                </div>
                <div class="line line-dashed b-b line-lg pull-in"></div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">包装</label>
                    <div class="col-sm-10">
                        <input class="form-control" ng-model="book.binding" placeholder="平装...">
                    </div>
                </div>
                <div class="line line-dashed b-b line-lg pull-in"></div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">种类</label>
                    <div class="col-sm-10">
                        <input class="form-control" ng-model="book.series.title" placeholder="未设置">
                    </div>
                </div>
                <div class="line line-dashed b-b line-lg pull-in"></div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">标签</label>
                    <div class="col-sm-10">
                        <button class="btn btn-success m-b-sm" ng-click="addTag(book)">添加标签</button>
                        <div class="panel panel-default">
                            <div class="panel-heading">
                                已添加标签
                            </div>
                            <div class="table-responsive">
                                <table class="table table-striped b-t b-light">
                                    <thead>
                                    <tr>
                                        <th style="width:100px;">名称</th>
                                        <th style="width:250px;">数量</th>
                                        <th style="width:70px;">删除</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <tr ng-repeat="tag in book.tags track by $index">
                                        <td><input class="form-control" ng-model="tag.name" placeholder="标签名称"></td>
                                        <td>{{tag.count}}</td>
                                        <td>
                                            <a><i class="fa fa-times text-danger text"
                                                  ng-click="delTag(book, $index)"></i></a>
                                        </td>
                                    </tr>
                                    </tbody>
                                </table>
                            </div>
                            <div class="panel-footer text-center" ng-show="!book.tags || book.tags.length == 0">
                                未添加标签
                            </div>
                        </div>
                    </div>
                </div>
                <div class="line line-dashed b-b line-lg pull-in"></div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">书籍作者</label>
                    <div class="col-sm-10">
                        <button class="btn btn-success m-b-sm" ng-click="addAuthor(book)">添加作者</button>
                        <div class="panel panel-default">
                            <div class="panel-heading">
                                已添加作者
                            </div>
                            <div class="table-responsive">
                                <table class="table table-striped b-t b-light">
                                    <thead>
                                    <tr>
                                        <th style="width:100px;">作者姓名</th>
                                        <th style="width:70px;">删除</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <tr ng-repeat="item in book.author track by $index">
                                        <td><input class="form-control" ng-model="book.author[$index]" placeholder="作者姓名"></td>
                                        <td>
                                            <a><i class="fa fa-times text-danger text"
                                                  ng-click="delAuthor(book, $index)"></i></a>
                                        </td>
                                    </tr>
                                    </tbody>
                                </table>
                            </div>
                            <div class="panel-footer text-center" ng-show="!book.author || book.author.length == 0">
                                未添加作者
                            </div>
                        </div>
                    </div>
                </div>
                <div class="line line-dashed b-b line-lg pull-in"></div>
                <div class="form-group">
                    <div class="form-group">
                        <label class="col-sm-2 control-label">书籍翻译</label>
                        <div class="col-sm-10">
                            <button class="btn btn-success m-b-sm" ng-click="addTranslator(book)">添加翻译</button>
                            <div class="panel panel-default">
                                <div class="panel-heading">
                                    已添加翻译
                                </div>
                                <div class="table-responsive">
                                    <table class="table table-striped b-t b-light">
                                        <thead>
                                        <tr>
                                            <th style="width:100px;">作者翻译</th>
                                            <th style="width:70px;">删除</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        <tr ng-repeat="item in book.translator track by $index">
                                            <td><input class="form-control" ng-model="book.translator[$index]" placeholder="翻译姓名"></td>
                                            <td>
                                                <a><i class="fa fa-times text-danger text"
                                                      ng-click="delTranslator(book, $index)"></i></a>
                                            </td>
                                        </tr>
                                        </tbody>
                                    </table>
                                </div>
                                <div class="panel-footer text-center" ng-show="!book.translator || book.translator.length == 0">
                                    未添加翻译
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="line line-dashed b-b line-lg pull-in"></div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">书籍封面</label>
                    <div class="col-sm-10">
                        <input class="form-control" ng-model="book.image" placeholder="封面链接">
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-sm-2"></div>
                    <div class="col-sm-10" ng-show="book.image">
                        <div class="thumbnail">
                            <img ngf-src="book.image"/>
                        </div>
                    </div>
                </div>
                <div class="line line-dashed b-b line-lg pull-in"></div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">书籍封面(小)</label>
                    <div class="col-sm-10">
                        <input class="form-control" ng-model="book.images.small" placeholder="封面链接">
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-sm-2"></div>
                    <div class="col-sm-10" ng-show="book.images.small">
                        <div class="thumbnail">
                            <img ngf-src="book.images.small"/>
                        </div>
                    </div>
                </div>
                <div class="line line-dashed b-b line-lg pull-in"></div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">书籍封面(中)</label>
                    <div class="col-sm-10">
                        <input class="form-control" ng-model="book.images.medium" placeholder="封面链接">
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-sm-2"></div>
                    <div class="col-sm-10" ng-show="book.images.medium">
                        <div class="thumbnail">
                            <img ngf-src="book.images.medium"/>
                        </div>
                    </div>
                </div>
                <div class="line line-dashed b-b line-lg pull-in"></div>
                <div class="form-group">
                    <label class="col-sm-2 control-label">书籍封面(大)</label>
                    <div class="col-sm-10">
                        <input class="form-control" ng-model="book.images.large" placeholder="封面链接">
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-sm-2"></div>
                    <div class="col-sm-10" ng-show="book.images.large">
                        <div class="thumbnail">
                            <img ngf-src="book.images.large"/>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <footer class="panel-footer text-left bg-light lter">
            <div class="col-sm-2"></div>
            <button type="submit" class="btn btn-primary btn-lg w-sm m-sm" ng-click="close()">关闭</button>
        </footer>
    </form>
</div>